##xxxxxxxxxxxxxxxxxxxxxx Paths configs
# message(STATUS "[ymy] CMake binary dir: ${CMAKE_BINARY_DIR}")
set(MY_ROOT_DIR "${CMAKE_SOURCE_DIR}" CACHE PATH "Project root directory")
message(STATUS "[ymy] Sub project root dir: ${MY_ROOT_DIR}")

##xxxxxxxxxxxxxxxxxxxxxx 所有子项目共享的 根目录
# get_filename_component(MY_REPO_DIR ${MY_ROOT_DIR} DIRECTORY CACHE "Totally git repo dir")
set(MY_REPO_DIR ${MY_ROOT_DIR} CACHE PATH "Totally git repo dir")
message(STATUS "[ymy] Git repo root dir: ${MY_REPO_DIR}")
set(MY_COMMON_DIR "${MY_REPO_DIR}/common" CACHE PATH "Common include directory")

##xxxxxxxxxxxxxxxxxxxxxx 二进制输出目录
# set(MY_PATH_BIN ${CMAKE_BINARY_DIR} CACHE PATH "Binary output directory") # build 结果 output directory
set(MY_PATH_BIN "${MY_ROOT_DIR}/bin" CACHE PATH "Binary output directory")
message(STATUS "[ymy] Binary output directory: ${MY_PATH_BIN}")
# 设置编译结果的输出目录
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${MY_PATH_BIN})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${MY_PATH_BIN})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${MY_PATH_BIN})

##xxxxxxxxxxxxxxxxxxxxxx 自行编译的第三方库
set(MY_THIRD_PARTY "${MY_ROOT_DIR}/thirdparty" CACHE PATH "Third party directory")

##xxxxxxxxxxxxxxxxxxxxxx 日志的输出目录
set(MY_LOG_DIR "${MY_PATH_BIN}/logs" CACHE PATH "Logs directory")

##xxxxxxxxxxxxxxxxxxxxxx dllexport header files dir
set(MY_EXPORTS_DIR "${MY_ROOT_DIR}/export_headers" CACHE PATH "Export headers directory")

##xxxxxxxxxxxxxxxxxxxxxx cmake install dir
set(CMAKE_INSTALL_PREFIX "${MY_ROOT_DIR}/inst-demo" CACHE PATH "Install path") # 安装目录, demo
message(STATUS "[ymy] Binary install demo directory: ${CMAKE_INSTALL_PREFIX}")

#xxxxxxxxxxxxxxxxxxx 让 generator 生成 compile database
# 导出 clangd 需要的 build/compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)